# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-httpretty
_pkgname=httpretty
pkgver=0.9.7
pkgrel=3
pkgdesc='HTTP client mock for Python.'
url='https://pypi.org/project/httpretty/#files'
arch=('any')
license=('MIT')
depends=('python2' 'python2-urllib3')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('4a1cdfc09af14ab2bc6eec84ad0905103ffb48c3154b127f646b39ff131584a52b1fd56bfe7a41959fc68d64eff94a221f9bf5a159a3dbfb3535fe4ac76c6170')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  chmod 644 \
    "$pkgdir/usr/lib/python2.7/site-packages/$_pkgname-$pkgver-py2.7.egg-info/PKG-INFO"
}

